//
//  MAPYSettingCell.swift
//  Mars Proxy
//
//  Created by PowerfullClean on 2023/10/16.
//

import UIKit

class MAPYSettingCell: UICollectionViewCell {
    override init(frame: CGRect) {
        super.init(frame: frame)
        contentView.addSubview(mapy_iconView)
        contentView.addSubview(mapy_titleLabel)
        mapy_iconView.snp.makeConstraints { make in
            make.size.equalTo(16)
            make.centerY.equalToSuperview()
            make.left.equalToSuperview().offset(50)
        }
        mapy_titleLabel.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(mapy_iconView.snp.right).offset(12)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    var mapy_settingModel: MAPYSettingModel? {
        didSet {
            guard let mapy_settingModel = mapy_settingModel else { return  }
            mapy_iconView.image = UIImage(named: mapy_settingModel.mapy_icon)
            mapy_titleLabel.text = mapy_settingModel.mapy_title
        }
    }
    lazy var mapy_iconView: UIImageView = {
        let mapy_iconView = UIImageView(image: UIImage(named: "mapy_setting_rate"))
        return mapy_iconView
    }()
    lazy var mapy_titleLabel: UILabel = {
        let mapy_titleLabel = UILabel()
        mapy_titleLabel.font = UIFont.systemFont(ofSize: 12)
        mapy_titleLabel.textColor = MAPYCommon.mapy_getHXColorValue(rgb: 0xFFFFFF)
        mapy_titleLabel.text = "Speed"
        return mapy_titleLabel
    }()
}
